package com.gitee.wsl.ext.any

/**
 * Returns true or false if the object is null
 */
fun Any?.isNotNull() = this != null

inline fun <reified T> isNullable(): Boolean = null is T

/**
 * @return whether the item exists and is one of the items in the collection
 */
fun <T> T.isOneOf(vararg items: T?): Boolean {
    this ?: return false
    return items.contains(this)
}

fun Pair<Any?,Any?>.entryNotEq():Boolean = first != second

fun Pair<Any?,Any?>.isNull():Boolean = first.isNotNull() or second.isNotNull()

